local scene = director:createScene()

function scene:setUp(event)
    dbg.print("sceneInstructions:setUp")

	local scaleX = 320/director.displayWidth
	local scaleY = 480/director.displayHeight
	
	local xValue = director.displayCenterX
	local yValue = director.displayCenterY
	
	local box2 = director:createRectangle( {x=xValue, y=yValue, w=240/scaleX, h=380/scaleY, color=color.green, xAnchor=0.5, yAnchor=0.5} )
	local labelInstructionsNine = director:createLabel({x=xValue, y=yValue+box2.h*5/16, hAlignment="center", xAnchor=0.5, color= color.black, xScale=1/scaleX, yScale=1/scaleY})
	local labelInstructionsOne = director:createLabel({x=xValue, y=yValue+box2.h*3/16, hAlignment="center", xAnchor=0.5, color= color.black, xScale=1/scaleX, yScale=1/scaleY})
	local labelInstructionsTwo = director:createLabel({x=xValue, y=yValue+box2.h/8, hAlignment="center", xAnchor=0.5, color= color.black, xScale=1/scaleX, yScale=1/scaleY})
	local labelInstructionsThree = director:createLabel({x=xValue, y=yValue+box2.h/16, hAlignment="center", xAnchor=0.5, color= color.black, xScale=1/scaleX, yScale=1/scaleY})
	local labelInstructionsFour = director:createLabel({x=xValue, y=yValue, hAlignment="center", xAnchor=0.5, color= color.black, xScale=1/scaleX, yScale=1/scaleY})
	local labelInstructionsFive = director:createLabel({x=xValue, y=yValue-box2.h/16, hAlignment="center", xAnchor=0.5, color= color.black, xScale=1/scaleX, yScale=1/scaleY})
	local labelInstructionsSix = director:createLabel({x=xValue, y=yValue-box2.h/8, hAlignment="center", xAnchor=0.5, color= color.black, xScale=1/scaleX, yScale=1/scaleY})
	local labelInstructionsSeven = director:createLabel({x=xValue, y=yValue-box2.h*3/16, hAlignment="center", xAnchor=0.5, color= color.black, xScale=1/scaleX, yScale=1/scaleY})
	local labelInstructionsEight = director:createLabel({x=xValue, y=yValue-box2.h*4, hAlignment="center", xAnchor=0.5, color= color.black, xScale=1/scaleX, yScale=1/scaleY})
		
	labelInstructionsOne.text="Must touch"
	labelInstructionsTwo.text="the meteorites"
	labelInstructionsThree.text="to destroy"
	labelInstructionsFour.text="them before"
	labelInstructionsFive.text="they impact "
	labelInstructionsSix.text="the planet and"
	labelInstructionsSeven.text="destroy all "
	labelInstructionsEight.text="life on it."
	labelInstructionsNine.text="Instructions"
		
	local buttonBack = director:createSprite(250/scaleX, 50/scaleY, "img/button.png")
	buttonBack.xAnchor=0.5; buttonBack.yAnchor=0.5
	buttonBack.xScale=.5/scaleX; buttonBack.yScale=.5/scaleY; 
	buttonBack.y = buttonBack.y - buttonBack.h/2.5/scaleY
	labelBack = director:createLabel(250/scaleX, 0, "Back")
	labelBack.xAnchor=0.5;
	labelBack.zOrder = buttonBack.zOrder
	labelBack. hAlignment="center"
	labelBack.xScale=1/scaleX
	labelBack.yScale=1/scaleY
	
	function buttonBack:touch(event)
		if (event.phase == 'began') then
			system:sendEvent("moveToSceneMenu")
		end
	end
	buttonBack:addEventListener('touch', buttonBack)
end

function scene:tearDown(event)
    dbg.print("sceneInstructions:tearDown")
end

scene:addEventListener({"setUp", "tearDown"}, scene)

return scene -- We must return the scene object!